package com.shareyi.study.springboot.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class TestController {

/*
    @RequestMapping(value = "/",produces = "text/plain;charset=UTF-8")
    public String index(){
        return "Hello Spring Boot!, DO you love me ?";
    }

*/

    @RequestMapping(value = "/hello")
   public Map hello(@RequestParam(required = false) String msg){
       Map hashMap = new HashMap();
       hashMap.put("hello",msg);
        hashMap.put("xxx",null);
       return hashMap;
    }

}